#define LOG_FMT(name, level, fmt)   "[" level "] (%s) " fmt "\n"
#define LOG_ARGS(name, level, ...)  name, ##__VA_ARGS__
#include "log.h"

int main(int argc, char *argv[])
{
    LogDev *dev = log_init_std(stderr, "demo", NONE);

    log_set_level(dev, INFO);
    LogLevel level = log_get_level(dev);
    printf("level: %s\n", log_level_name(level));

    log(dev, DEBUG, "hello world");
    log(dev, DEBUG, "hello world %d", 2);
    log(dev, INFO,  "hello world");
    log(dev, INFO,  "hello world %d", 2);
    log(dev, WARN,  "hello world");
    log(dev, WARN,  "hello world %d", 2);
    log(dev, ERROR, "hello world");
    log(dev, ERROR, "hello world %d", 2);

    log_free(dev);

    return 0;
}
